package gc;

public class TestAllocation {
    private static final int _1MB = 1024 * 1024;
    /**
     * java -verbose:gc -Xms20M -Xmx20M -XX:+PrintGC -XX:+PrintGCDetails -XX:SurvivorRatio=8
     *
     */
    public static void allocate() {
        byte[] b1,b2,b3,b4,b5;
        b1 = new byte[2 * _1MB];
        b2 = new byte[2 * _1MB];
        b3 = new byte[2 * _1MB];
//        b4 = new byte[2 * _1MB];
//        b4=null;
//        b4 = new byte[2 * _1MB];
    }
    public static void allocate1() {
        byte[] b1 = new byte[6 * _1MB];
        byte[] b2 = new byte[1024*100];
        byte[] b3 = new byte[1024*100];
//        byte[] b2 = new byte[1 * _1MB];
//        b4 = new byte[2 * _1MB];
//        b4=null;
//        b4 = new byte[2 * _1MB];
    }
    public static void main(String[] args) {
        allocate1();
    }
}
